import time, random
from multiprocessing import Process
from threading import Thread

# 全局变量
num = 100


def func():
    global num
    num -= 1


if __name__ == '__main__':
    obj_list = []
    for i in range(10):
        t = Thread(target=func)
        t.start()
        obj_list.append(t)

    for t in obj_list:
        t.join()

    print(num)  # num = 90
